<?php
/**
 * Created by PhpStorm.
 * User: jwb
 * Date: 2020/9/23
 * Time: 15:11
 */

namespace App\Inventor\Extensions\Grids\Displayers\Actions;

use Encore\Admin\Grid\Displayers\Actions;

class Edit
{
    protected $id;
    protected $actions;

    public function __construct(Actions $actions)
    {
        $this->actions = $actions;
    }

    protected function script()
    {
        return <<<SCRIPT


SCRIPT;
    }

    protected function render()
    {
        return <<<EOT
<a href="{$this->actions->getResource()}/{$this->actions->getRouteKey()}/edit" class="grid-row-edit">
    编辑
</a>
EOT;
    }

    public function __toString()
    {
        return $this->render();
    }
}